

#import "TradeSystemOptimized.h"
#import "GridTableCell.h"


#define LABEL_c0r0 900 
#define LABEL_c0r1 901 
#define LABEL_c1r0 910 
#define LABEL_c1r1 911 
#define LABEL_c2r0 920 
#define LABEL_c2r1 921  
#define LABEL_c3r0 930 
#define LABEL_c3r1 931 

@implementation TradeSystemOptimized
@synthesize delegate;
@synthesize delegate_UIPopoverController;


#pragma mark -
#pragma mark Initialization


-(id)initWithTargetSymbol:(DataObject *)adataobject {
	
	if (self==[super init]) {
		
		
		stockdata=adataobject;
		
		
	}
	return self;	 	
}


- (void)loadView {
	
	UIView *mainview;
	mainview=[[UIView alloc]initWithFrame:[UIScreen mainScreen].applicationFrame];
	self.view=mainview;
    [mainview release];
	self.view.backgroundColor=[UIColor lightTextColor];	
	UINavigationBar *nav;
	
	nav = [[UINavigationBar alloc] initWithFrame: CGRectMake(0.0f, 0.0f, 320.0f, 48.0f)];	
	
	UIBarButtonItem *barButton ;
	barButton = [[UIBarButtonItem alloc] initWithTitle:NSLocalizedString(@"Done",@"完成")  style:UIBarButtonItemStylePlain target:self action:@selector(slideOut)];
	UINavigationItem *item;
	item = [[UINavigationItem alloc] initWithTitle:  @"交易明細"  ];
	[item setRightBarButtonItem: barButton];
    [barButton release];
	[nav pushNavigationItem:item animated:NO];	
	[item release];
	
	//UIBarButtonItem *rightButton =[[UIBarButtonItem alloc] initWithTitle:@"GoBack" style:UIBarButtonItemStyleDone target:self action:@selector(slideOut)];
	
	myTable = [[UITableView alloc] initWithFrame:CGRectMake(0.0f, 48.0f, 320.0f, self.view.frame.size.height)  style:UITableViewStylePlain];
	myTable.dataSource = self;	//連結資料 UITableViewDataSource
	myTable.delegate=self; //連結動作 UITableViewDelegate	
	[self.view addSubview:myTable];
	
	
	//[self.view addSubview:headerbutton];
	[mainview addSubview:nav ];	
	[nav release];
}

#pragma mark -
#pragma mark  退出至上一層
-(void)slideOut{
		
    if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad){
        [delegate_UIPopoverController dismissPopoverAnimated:YES]; 
    }    
	else{
       [self.delegate TradeSystemOptimizedRecordDidFinish:self];   
    }
   	
    
    
    
}
#pragma mark -
#pragma mark Table view data source


- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
	return 1;
}


- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
	tableView.separatorStyle = UITableViewCellSeparatorStyleSingleLine;
	return [stockdata.financialData_TradeSystem_Optimize count];
}
//表格頭標題
//HeaderInSection 增加物件
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{
	return 75;
}

- (UIView *) tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section {
	UIView* customView = [[[UIView alloc] initWithFrame:CGRectMake(30.0, 0.0, 100.0, 200.0)] autorelease];
  	
 	NSArray *tradesystemopt=stockdata.financialData_TradeSystem_Optimize;
	NSDictionary *toData = (NSDictionary *)[tradesystemopt objectAtIndex:[ stockdata.financialData_TradeSystem_Optimize count] -1];
	
	
	//section 底色設定
	customView.backgroundColor = [UIColor lightGrayColor];
	
	NSString *c0r0;
	NSString *c0r1;
	NSString *c1r0;
	NSString *c1r1;
	NSString *c2r0;
	NSString *c2r1;
	NSString *c3r0;
	NSString *c3r1;
	NSString *r2c0;	
	NSString *r2c1;	
	NSString *r3c0;	
	NSString *r3c1;		
	c0r0=@"";
	c0r1=@"";
	c1r0=@"";
	c1r1=@"";
	c2r0=@"";
	c2r1=@"";
	c3r0=@"";
	c3r1=@"";
	r2c0=@"測試策略:";
	r2c1=@"測試週期:";
	r2c1=[r2c1 stringByAppendingString:[toData objectForKey:@"dwm"]];
	
	r3c0=@"開始:";
	 
	NSDate *startDate= [toData objectForKey:@"startdate"];	
	NSDateFormatter* starta = [[NSDateFormatter alloc]init];
	[starta setDateFormat:@"yyyy/MM/dd"];
	NSString *wstart = [starta stringFromDate:startDate];
    [starta release];
    r3c0=[r3c0 stringByAppendingString:wstart];
	 
	
	r3c1=@"結束:";	
	NSDate *endDate= [toData objectForKey:@"enddate"];	
	NSDateFormatter* enda = [[NSDateFormatter alloc]init];
	[enda setDateFormat:@"yyyy/MM/dd"];
	NSString *wend = [enda stringFromDate:endDate];	
	[enda release];
    
    r3c1=[r3c1 stringByAppendingString:wend];
	//決定要使用哪一個程式交易策略
	NSString *Optimizetradesystem;
	NSUserDefaults *prefs = [NSUserDefaults standardUserDefaults];	
	 
	Optimizetradesystem=[prefs objectForKey:@"OptimizeTradeSystem"]  ;
		
		
	 
	
	r2c0=[r2c0 stringByAppendingString:Optimizetradesystem];
	
	
	if ([Optimizetradesystem isEqualToString:@"MESA"]) {
		c0r0= @"FastLim";	
		c0r1= @"SlowLim";
		c1r0= @"勝率";	
		c2r0= @"年報酬率";
		c3r0= @"交易次數";	
		 	
	} 
	else if([Optimizetradesystem isEqualToString:@"LF"]) {
		c0r0= @"BRangeDay";	
		c0r1= @"SRangeDay";
		c1r0= @"Bratio";	
		c1r1= @"Sratio";		
		
		c2r0= @"勝率";	
		c2r1= @"年報酬率";
		c3r0= @"交易次數";
	}	
	
	int starty;
	starty=40;
	
	
	UILabel * headerLabel_r2c0 = [[[UILabel alloc] initWithFrame:CGRectZero] autorelease];
	headerLabel_r2c0.backgroundColor = [UIColor clearColor];
	headerLabel_r2c0.opaque = NO;
	headerLabel_r2c0.textColor = [UIColor blueColor];
	headerLabel_r2c0.font = [UIFont boldSystemFontOfSize:13];
	headerLabel_r2c0.frame = CGRectMake(10,-5, 100.0, 30.0);
	headerLabel_r2c0.textAlignment = UITextAlignmentLeft;
	headerLabel_r2c0.text = [NSString stringWithString:r2c0 ];
	headerLabel_r2c0.alpha=1;	
	[customView addSubview:headerLabel_r2c0];
	
	UILabel * headerLabel_r2c1 = [[[UILabel alloc] initWithFrame:CGRectZero] autorelease];
	headerLabel_r2c1.backgroundColor = [UIColor clearColor];
	headerLabel_r2c1.opaque = NO;
	headerLabel_r2c1.textColor = [UIColor blueColor];
	headerLabel_r2c1.font = [UIFont boldSystemFontOfSize:13];
	headerLabel_r2c1.frame = CGRectMake(180,-5, 100.0, 30.0);
	headerLabel_r2c1.textAlignment = UITextAlignmentLeft;
	headerLabel_r2c1.text = [NSString stringWithString:r2c1 ];
	headerLabel_r2c1.alpha=1;	
	[customView addSubview:headerLabel_r2c1];
	
	UILabel * headerLabel_r3c0 = [[[UILabel alloc] initWithFrame:CGRectZero] autorelease];
	headerLabel_r3c0.backgroundColor = [UIColor clearColor];
	headerLabel_r3c0.opaque = NO;
	headerLabel_r3c0.textColor = [UIColor blueColor];
	headerLabel_r3c0.font = [UIFont boldSystemFontOfSize:13];
	headerLabel_r3c0.frame = CGRectMake(10,10, 100.0, 30.0);
	headerLabel_r3c0.textAlignment = UITextAlignmentLeft;
	headerLabel_r3c0.text = [NSString stringWithString:r3c0 ];
	headerLabel_r3c0.alpha=1;	
	[customView addSubview:headerLabel_r3c0];
	
	UILabel * headerLabel_r3c1 = [[[UILabel alloc] initWithFrame:CGRectZero] autorelease];
	headerLabel_r3c1.backgroundColor = [UIColor clearColor];
	headerLabel_r3c1.opaque = NO;
	headerLabel_r3c1.textColor = [UIColor blueColor];
	headerLabel_r3c1.font = [UIFont boldSystemFontOfSize:13];
	headerLabel_r3c1.frame = CGRectMake(180,10, 100.0, 30.0);
	headerLabel_r3c1.textAlignment = UITextAlignmentLeft;
	headerLabel_r3c1.text = [NSString stringWithString:r3c1 ];
	headerLabel_r3c1.alpha=1;	
	[customView addSubview:headerLabel_r3c1];	
	
	//===========================
	
	UILabel * headerLabel_c0r0 = [[[UILabel alloc] initWithFrame:CGRectZero] autorelease];
	headerLabel_c0r0.backgroundColor = [UIColor clearColor];
	headerLabel_c0r0.opaque = NO;
	headerLabel_c0r0.textColor = [UIColor blueColor];
	headerLabel_c0r0.font = [UIFont boldSystemFontOfSize:13];
	headerLabel_c0r0.frame = CGRectMake(10,-10+starty, 100.0, 30.0);
	headerLabel_c0r0.textAlignment = UITextAlignmentLeft;
	headerLabel_c0r0.text = [NSString stringWithString:c0r0 ];
	headerLabel_c0r0.alpha=1;	
	[customView addSubview:headerLabel_c0r0];
	
	UILabel * headerLabel_c0r1 = [[[UILabel alloc] initWithFrame:CGRectZero] autorelease];
	headerLabel_c0r1.backgroundColor = [UIColor clearColor];
	headerLabel_c0r1.opaque = NO;
	headerLabel_c0r1.textColor = [UIColor redColor];
	headerLabel_c0r1.font = [UIFont boldSystemFontOfSize:13];
	headerLabel_c0r1.frame = CGRectMake(10,5+starty, 100.0, 30.0);
	headerLabel_c0r1.textAlignment = UITextAlignmentLeft;
	headerLabel_c0r1.text = [NSString stringWithString: c0r1 ];
	headerLabel_c0r1.alpha=1;	
	[customView addSubview:headerLabel_c0r1];	
	
	UILabel * headerLabel_c1r0 = [[[UILabel alloc] initWithFrame:CGRectZero] autorelease];
	headerLabel_c1r0.backgroundColor = [UIColor clearColor];
	headerLabel_c1r0.opaque = NO;
	headerLabel_c1r0.textColor = [UIColor blueColor];
	headerLabel_c1r0.font = [UIFont boldSystemFontOfSize:13];
	headerLabel_c1r0.frame = CGRectMake(100,-10+starty, 100.0, 30.0);
	headerLabel_c1r0.textAlignment = UITextAlignmentLeft;
	headerLabel_c1r0.text = [NSString stringWithString:c1r0 ];
	headerLabel_c1r0.alpha=1;	
	[customView addSubview:headerLabel_c1r0];			  
	
	UILabel * headerLabel_c1r1 = [[[UILabel alloc] initWithFrame:CGRectZero] autorelease];
	headerLabel_c1r1.backgroundColor = [UIColor clearColor];
	headerLabel_c1r1.opaque = NO;
	headerLabel_c1r1.textColor = [UIColor redColor];
	headerLabel_c1r1.font = [UIFont boldSystemFontOfSize:13];
	headerLabel_c1r1.frame = CGRectMake(100,5+starty, 100.0, 30.0);
	headerLabel_c1r1.textAlignment = UITextAlignmentLeft;
	headerLabel_c1r1.text = [NSString stringWithString:c1r1];
	headerLabel_c1r1.alpha=1;	
	[customView addSubview:headerLabel_c1r1];		  
	
	
	UILabel * headerLabel_c2r0 = [[[UILabel alloc] initWithFrame:CGRectZero] autorelease];
	headerLabel_c2r0.backgroundColor = [UIColor clearColor];
	headerLabel_c2r0.opaque = NO;
	headerLabel_c2r0.textColor = [UIColor blueColor];
	headerLabel_c2r0.font = [UIFont boldSystemFontOfSize:13];
	headerLabel_c2r0.frame = CGRectMake(180,-10+starty, 100.0, 30.0);
	headerLabel_c2r0.textAlignment = UITextAlignmentLeft;
	headerLabel_c2r0.text = [NSString stringWithString:c2r0];
	headerLabel_c2r0.alpha=1;	
	[customView addSubview:headerLabel_c2r0];			  
	
	UILabel * headerLabel_c2r1 = [[[UILabel alloc] initWithFrame:CGRectZero] autorelease];
	headerLabel_c2r1.backgroundColor = [UIColor clearColor];
	headerLabel_c2r1.opaque = NO;
	headerLabel_c2r1.textColor = [UIColor redColor];
	headerLabel_c2r1.font = [UIFont boldSystemFontOfSize:13];
	headerLabel_c2r1.frame = CGRectMake(180,5+starty, 100.0, 30.0);
	headerLabel_c2r1.textAlignment = UITextAlignmentLeft;
	headerLabel_c2r1.text = [NSString stringWithString:c2r1  ];
	headerLabel_c2r1.alpha=1;	
	[customView addSubview:headerLabel_c2r1];		
	
	
	UILabel * headerLabel_c3r0 = [[[UILabel alloc] initWithFrame:CGRectZero] autorelease];
	headerLabel_c3r0.backgroundColor = [UIColor clearColor];
	headerLabel_c3r0.opaque = NO;
	headerLabel_c3r0.textColor = [UIColor blueColor];
	headerLabel_c3r0.font = [UIFont boldSystemFontOfSize:13];
	headerLabel_c3r0.frame = CGRectMake(260,-10+starty, 100.0, 30.0);
	headerLabel_c3r0.textAlignment = UITextAlignmentLeft;
	headerLabel_c3r0.text = [NSString stringWithString:c3r0 ];
	headerLabel_c3r0.alpha=1;	
	[customView addSubview:headerLabel_c3r0];			
	
	UILabel * headerLabel_c3r1 = [[[UILabel alloc] initWithFrame:CGRectZero] autorelease];
	headerLabel_c3r1.backgroundColor = [UIColor clearColor];
	headerLabel_c3r1.opaque = NO;
	headerLabel_c3r1.textColor = [UIColor blueColor];
	headerLabel_c3r1.font = [UIFont boldSystemFontOfSize:13];
	headerLabel_c3r1.frame = CGRectMake(260,5+starty, 100.0, 30.0);
	headerLabel_c3r1.textAlignment = UITextAlignmentLeft;
	headerLabel_c3r1.text = [NSString stringWithString:c3r1 ];
	headerLabel_c3r1.alpha=1;	
	[customView addSubview:headerLabel_c3r1];		
	

	
	 
	
	
	
	return customView;	
	
	
	
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
	
	
	NSString *MyIdentifier = [NSString stringWithFormat:@"MyIdentifier %i", indexPath.row];
	
	GridTableCell *cell = (GridTableCell *)[tableView dequeueReusableCellWithIdentifier:MyIdentifier];
	
	if (cell == nil) {
		cell = [[[GridTableCell alloc] initWithFrame:CGRectZero  ] autorelease];
		
		NSArray *tradesystemopt=stockdata.financialData_TradeSystem_Optimize;
		NSDictionary *toData = (NSDictionary *)[tradesystemopt objectAtIndex:[ stockdata.financialData_TradeSystem_Optimize count] -indexPath.row-1];
		
		
		
		[cell addColumn:80];
		[cell addColumn:160];		
		[cell addColumn:240];		
		[cell addColumn:320];		
		
		
		NSString *c0r0;
		NSString *c0r1;
		NSString *c1r0;
		NSString *c1r1;
		NSString *c2r0;
		NSString *c2r1;
		NSString *c3r0;
		NSString *c3r1;
		
	 
		
		//決定要使用哪一個程式交易策略
		NSString *Optimizetradesystem;
		NSUserDefaults *prefs = [NSUserDefaults standardUserDefaults];	
		 
		Optimizetradesystem=[prefs objectForKey:@"OptimizeTradeSystem"]  ;
		 
		if ([Optimizetradesystem isEqualToString:@"MESA"]) {
			c0r0=[NSString stringWithFormat:@"%0.03f", [[toData objectForKey:@"FastLim"] floatValue]];
			c0r1=[NSString stringWithFormat:@"%0.03f", [[toData objectForKey:@"SlowLim"] floatValue]];
			c1r0=[NSString stringWithFormat:@"%0.03f", [[toData objectForKey:@"WinPercentage"] floatValue]];
		    c1r1=@"";
			c2r0=[NSString stringWithFormat:@"%0.03f", [[toData objectForKey:@"YearPercentageRealizeGainLoss"] floatValue]];
		    c2r1=@"";
			c3r0=[NSString stringWithFormat:@"%i", [[toData objectForKey:@"TotalCount"] intValue]];
			c3r1=@"";
		} 
		else if([Optimizetradesystem isEqualToString:@"LF"]) {
			c0r0=[NSString stringWithFormat:@"%i", [[toData objectForKey:@"BRangeDay"] intValue]];
			c0r1=[NSString stringWithFormat:@"%i", [[toData objectForKey:@"SRangeDay"] intValue]];
			c1r0=[NSString stringWithFormat:@"%0.03f", [[toData objectForKey:@"Bratio"] floatValue]];
			c1r1=[NSString stringWithFormat:@"%0.03f", [[toData objectForKey:@"Sratio"] floatValue]];
			
			
			c2r0=[NSString stringWithFormat:@"%0.03f", [[toData objectForKey:@"WinPercentage"] floatValue]];
		    c2r1=[NSString stringWithFormat:@"%0.03f", [[toData objectForKey:@"YearPercentageRealizeGainLoss"] floatValue]];
		    c3r0=[NSString stringWithFormat:@"%i", [[toData objectForKey:@"TotalCount"] intValue]];
			c3r1=@"";			
			
			
		}
		
		 
		
		
		
		
		UILabel *label = [[[UILabel	alloc] initWithFrame:CGRectMake(0.0, 0,50.0, tableView.rowHeight/2)] autorelease]; 
		label.tag =  LABEL_c0r0; 
		label.font= [UIFont systemFontOfSize:13.0]; 
		label.text=c0r0;
		label.textAlignment = UITextAlignmentRight; 
		label.textColor = [UIColor blueColor]; 
		label.autoresizingMask = UIViewAutoresizingFlexibleRightMargin | 
		
		UIViewAutoresizingFlexibleHeight; 
		[cell.contentView addSubview:label]; 
		
		label =  [[[UILabel	alloc] initWithFrame:CGRectMake( 0.0, 20,50.0, tableView.rowHeight/2)] autorelease]; 
		label.tag =  LABEL_c0r1; 
		label.font = [UIFont systemFontOfSize:13.0]; 
		label.text =c0r1 ; 
		label.textAlignment = UITextAlignmentRight; 
		label.textColor = [UIColor redColor]; 
		label.autoresizingMask = UIViewAutoresizingFlexibleRightMargin | 
		UIViewAutoresizingFlexibleHeight; 
		[cell.contentView addSubview:label]; 
		
		
		
		
		
		label =  [[[UILabel	alloc] initWithFrame:CGRectMake(90.0, 0, 50.0, tableView.rowHeight/2) ] autorelease]; 		
		label.tag =  LABEL_c1r0; 
		label.font = [UIFont systemFontOfSize:13.0]; 
		// add some silly value
		label.text =c1r0 ;
		label.textAlignment = UITextAlignmentRight; 
		label.textColor = [UIColor blueColor]; 
		label.autoresizingMask = UIViewAutoresizingFlexibleRightMargin | 
		UIViewAutoresizingFlexibleHeight; 
		[cell.contentView addSubview:label];
 		
		
		
		label =  [[[UILabel	alloc] initWithFrame:CGRectMake(90.0, 20, 50.0, tableView.rowHeight/2) ] autorelease]; 		
		label.tag = LABEL_c1r1; 
		label.font = [UIFont systemFontOfSize:13.0]; 
		// add some silly value
		label.text =c1r1 ;
		label.textAlignment = UITextAlignmentRight; 
		label.textColor = [UIColor redColor]; 
		label.autoresizingMask = UIViewAutoresizingFlexibleRightMargin | 
		UIViewAutoresizingFlexibleHeight; 
		[cell.contentView addSubview:label];
		
		
		label =  [[[UILabel	alloc] initWithFrame:CGRectMake(170.0, 0, 50.0, tableView.rowHeight/2) ] autorelease]; 		
		label.tag =  LABEL_c2r0; 
		label.font = [UIFont systemFontOfSize:13.0]; 
		// add some silly value
		label.text = c2r0 ;
		label.textAlignment = UITextAlignmentRight; 
		label.textColor = [UIColor blueColor]; 
		label.autoresizingMask = UIViewAutoresizingFlexibleRightMargin | 
		UIViewAutoresizingFlexibleHeight; 
		[cell.contentView addSubview:label];
 		
		
		
		label =  [[[UILabel	alloc] initWithFrame:CGRectMake(170.0, 20, 50.0, tableView.rowHeight/2) ] autorelease]; 		
		label.tag = LABEL_c2r1; 
		label.font = [UIFont systemFontOfSize:13.0]; 
		// add some silly value
		label.text = c2r1;
		label.textAlignment = UITextAlignmentRight; 
		label.textColor = [UIColor redColor]; 
		label.autoresizingMask = UIViewAutoresizingFlexibleRightMargin | 
		UIViewAutoresizingFlexibleHeight; 
		[cell.contentView addSubview:label];		
		
		
		label =  [[[UILabel	alloc] initWithFrame:CGRectMake(240.0, 0, 70.0, tableView.rowHeight/2) ] autorelease]; 		
		label.tag = LABEL_c3r0; 
		label.font = [UIFont systemFontOfSize:11.0]; 
		// add some silly value
		label.text =c3r0;
		label.textAlignment = UITextAlignmentRight; 
		label.textColor = [UIColor blueColor]; 
		label.autoresizingMask = UIViewAutoresizingFlexibleRightMargin | 
		UIViewAutoresizingFlexibleHeight; 
		[cell.contentView addSubview:label];		
		
		label =  [[[UILabel	alloc] initWithFrame:CGRectMake(240.0, 20, 70.0, tableView.rowHeight/2) ] autorelease]; 		
		label.tag = LABEL_c3r1; 
		label.font = [UIFont systemFontOfSize:11.0]; 
		// add some silly value
		label.text =c3r1;
		label.textAlignment = UITextAlignmentRight; 
		label.textColor = [UIColor blueColor]; 
		label.autoresizingMask = UIViewAutoresizingFlexibleRightMargin | 
		UIViewAutoresizingFlexibleHeight; 
		[cell.contentView addSubview:label];		
		
	}
	
	return cell;
	
	
	
	
	
	
	
	
	
	
	
	 
}

/*
 // Override to support conditional editing of the table view.
 - (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath {
 // Return NO if you do not want the specified item to be editable.
 return YES;
 }
 */


/*
 // Override to support editing the table view.
 - (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath {
 
 if (editingStyle == UITableViewCellEditingStyleDelete) {
 // Delete the row from the data source.
 [tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationFade];
 }   
 else if (editingStyle == UITableViewCellEditingStyleInsert) {
 // Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view.
 }   
 }
 */


/*
 // Override to support rearranging the table view.
 - (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath {
 }
 */


/*
 // Override to support conditional rearranging of the table view.
 - (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath {
 // Return NO if you do not want the item to be re-orderable.
 return YES;
 }
 */


#pragma mark -
#pragma mark Table view delegate

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    // Navigation logic may go here. Create and push another view controller.
    /*
	 <#DetailViewController#> *detailViewController = [[<#DetailViewController#> alloc] initWithNibName:@"<#Nib name#>" bundle:nil];
     // ...
     // Pass the selected object to the new view controller.
	 [self.navigationController pushViewController:detailViewController animated:YES];
	 [detailViewController release];
	 */
}


#pragma mark -
#pragma mark Memory management

- (void)didReceiveMemoryWarning {
    // Releases the view if it doesn't have a superview.
    [super didReceiveMemoryWarning];
    
    // Relinquish ownership any cached data, images, etc. that aren't in use.
}

- (void)viewDidUnload {
    // Relinquish ownership of anything that can be recreated in viewDidLoad or on demand.
    // For example: self.myOutlet = nil;
}


- (void)dealloc {
    [super dealloc];
}

@end